home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 52 / Amiga Format AFCD52 (Issue 136, May 2000).iso / -in_the_mag- / multitasking / monitors / top / top_stub.asm < prev    next >
Assembly Source File  |  2000-03-05  |  355b  |  31 lines

  1. ;
  2. ;    top_stub.asm
  3. ;
  4. ;    Gary Duncan; March 1996
  5. ;
  6. ;    This is simply a wrapper which saves and restores
  7. ;    registers around a C-function (my_switch).
  8. ;
  9. ;
  10.  
  11.  
  12.     csect    text,0
  13.  
  14.     XDEF    _wrapper
  15.     XDEF    _oldswitch
  16.  
  17.     XREF    _myswitch
  18.  
  19. _wrapper:
  20.     movem.l    d0-d7/a0-a6,-(sp)
  21.  
  22.     jsr    _myswitch    
  23.  
  24.     movem.l    (sp)+,d0-d7/a0-a6    
  25.     move.l    _oldswitch,-(sp)
  26.     rts
  27.  
  28. _oldswitch:    dc.l    0
  29.  
  30.     end    
  31.